package com.zxy.zxyrpc.loadBalancer;

import com.zxy.zxyrpc.spi.SpiLoader;

/**
 * 负载均衡器工厂
 *
 * @author zxy
 * @since 2025/5/27
 **/
public class LoadBalancerFactory {
    /* 在 SPI 中的 getInstance 方法动态加载可能会更好
    static {
        SpiLoader.load(LoadBalancer.class);
    }*/

    private final LoadBalancer DEFAULT_LOAD_BALANCER = new RoundRobinLoadBanlancer();

    public static LoadBalancer getInstance(String key) {
        return SpiLoader.getInstance(LoadBalancer.class, key);
    }
}
